import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:zootix/store/zt_auth.store.dart';
import 'package:zootix/util/zt_screen_adaper_util.dart';
import 'package:zootix/constants/zt_router.dart';

class ZtMyCoinsWidget extends StatelessWidget {
  const ZtMyCoinsWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return InkWell(
        onTap: () {
          Get.toNamed(ZtRouteConfig.goodsList);
        },
        child: Container(
          padding: EdgeInsets.symmetric(
              vertical: ZtScreenAdaper.height(2),
              horizontal: ZtScreenAdaper.width(5)),
          decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10),
              color: const Color(0xFFFFCA41)),
          child: Row(children: [
            Image(
                height: ZtScreenAdaper.height(25),
                image: const AssetImage('assets/images/coin_icon.png')),
            SizedBox(
              width: ZtScreenAdaper.width(5),
            ),
            Obx(() => Text(
                  '${ZtAuthStore.to.userInfo.value.availableCoins ?? 0}',
                  style: TextStyle(
                      fontSize: ZtScreenAdaper.sp(18), color: Colors.white),
                )),
            SizedBox(
              width: ZtScreenAdaper.width(5),
            ),
            Icon(Icons.arrow_forward_ios,
                size: ZtScreenAdaper.sp(18), color: Colors.white),
          ]),
        ));
  }
}
